package approvalDao;
/**
 * \* Created with IntelliJ IDEA.
 * \* User: LYZ
 * \* Date: 2022/2/19
 * \* Time: 17:29
 * \* Description:
 * \
 */
public class Information {
    //书名
    private String bookName;
    //借书者
    private String userName;
    //借书时间
    private String borrowDate;
    //还书时间
    private String backDate;
    //联系方式
    private String email;
    //目前状态：待审批
    private String status;
    //操作：同意/不同意
    private String choice;


    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getBorrowDate() {
        return borrowDate;
    }

    public void setBorrowDate(String borrowDate) {
        this.borrowDate = borrowDate;
    }

    public String getBackDate() {
        return backDate;
    }

    public void setBackDate(String backDate) {
        this.backDate = backDate;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getChoice() {
        return choice;
    }

    public void setChoice(String choice) {
        this.choice = choice;
    }

    /*
        更新书籍状态
         */
    public static String UpdateStatus(String choice)  {

        if(choice!=null&&choice.equals("同意")){
            return "已同意";
        }
        return "已拒绝";
    }

    public static String Feedback(String status){
        if (status!=null&&status.equals("已同意")){
            return "你的借书申请已被批准";
        }
        return "管理员拒绝了你的借书申请";
    }

    @Override
    public String toString() {
        return "Information{" +
                "bookName='" + bookName + '\'' +
                ", userName='" + userName + '\'' +
                ", borrowDate='" + borrowDate + '\'' +
                ", backDate='" + backDate + '\'' +
                ", email='" + email + '\'' +
                ", status='" + status + '\'' +
                ", choice='" + choice + '\'' +
                '}';
    }
}
